﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Luminji.ExamWeb.Models.LogOnModel>" %>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Log On
</asp:Content>
<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Log On</h2>
    <p>
        请输入用户名和密码：
        <%: Html.ActionLink("Register", "Register") %>
        if you don't have an account.
    </p>
    <script src="../../Scripts/jquery-validation-1.9.0/jquery.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-validation-1.9.0/localization/messages_cn.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#loginForm").validate();
            $("#loginForm").submit(null, function () {
                if ($("#RememberMe").attr("checked") == true) {
                    $("#RememberMe").val(true);
                }
                else {
                    $("#RememberMe").val(false);
                }

            });
        });
</script>
    <form id="loginForm" method="post" action="">
    <%if (this.ViewBag.LoginError != null)
      {
    %>
    <script language="javascript">
        alert('<%=ViewBag.LoginError %>');
    </script>
    <%
      }
      this.ViewBag.LoginError = null;
    %>
    <div>
        <fieldset>
            <legend>Account Information</legend>
            <div class="editor-label">
                用户名（最少5位数）：
            </div>
            <div class="editor-field">
                <input id="UserName" name="UserName" class="required" minlength="5" value="<%=
      Model == null? "aa" : Model.UserName %>"/>
            </div>
            <div class="editor-label">
                密码（6-20位之间）：
            </div>
            <div class="editor-field">
                <input id="Password" name="Password" type="password" class="text required" minlength="6"
                    maxlength="20" />
            </div>
            <div class="editor-label">
                <input id="RememberMe" name="RememberMe" type="checkbox" />记住我
            </div>
            <p>
                <input type="submit" value="Log On" />
            </p>
        </fieldset>
    </div>
    </form>
</asp:Content>
